﻿
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace RegularExpressStudy
{
    class Match2
    {
        public static void Show()
        {
            string str1 = "1-800-808-8989";
            string par = @"\d-\d\d\d-\d\d\d-\d\d\d\d";
            Console.WriteLine(Regex.IsMatch(str1, par));

            str1 = "x-800-898-9999";
            par = @"\w-\d\d\d-\d\d\d-\d\d\d\d";
            Console.WriteLine(Regex.IsMatch(str1,par));

            str1 = "March 31, 2006";
            par = @"[a-zA-Z]{2} \d\d.\d\d\d\d";
            Console.WriteLine(Regex.IsMatch(str1,par));

            Console.ReadLine();
        }
    }
}
